翻訳と辞書
Words near each other
・ generate
・ generation
・ generic array logic
・ generic expert system tool
・ generic identifier
・ generic markup
・ generic programming
・ generic routing encapsulation
・ generic security service application programming interface
・ generic thunk
generic type variable
・ genericity
・ genesia
・ genetic algorithm
・ genetic algorithms
・ genetic programming
・ genie services
・ genken programming language
・ genova
・ gensym


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

generic type variable : FOLDOC
generic type variable
(Also known as a "schematic type variable"). Different occurrences of a generic type variable in a type expression may be instantiated to different types. Thus, in the expression
let id x = x in
(id True, id 1)

id's type is (for all a: a -> a). The universal quantifier "for all a:" means that a is a generic type variable. For the two uses of id, a is instantiated to Bool and Int. Compare this with
let id x = x in
let f g = (g True, g 1) in
f id

This looks similar but f has no legal {Hindley-Milner type}. If we say
f :: (a -> b) -> (b, b)

this would permit g's type to be any instance of (a -> b) rather than requiring it to be at least as general as (a -> b). Furthermore, it constrains both instances of g to have the same result type whereas they do not. The type variables a and b in the above are implicitly quantified at the top level:
f :: for all a: for all b: (a -> b) -> (b, b)

so instantiating the


スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.